From 23496e5afbdd5e65e4dac63eedef26baf324621f Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Thu, 14 Dec 2006 15:12:38 +0000 Subject: [PATCH] [TOOLS] A couple of check-script cleanups. Signed-off-by: Keir Fraser --- tools/check/check_python | 5 ++++- tools/check/check_python_xml | 15 +++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/check/check_python b/tools/check/check_python index e56f5a9684..6d665ea4b2 100755 --- a/tools/check/check_python +++ b/tools/check/check_python @@ -3,7 +3,10 @@ RC=0 -python -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || RC=1 +python -c ' +import sys +sys.exit(sys.version_info[0] < 2 or sys.version_info[1] < 2) +' || RC=1 if test ${RC} -ne 0; then echo diff --git a/tools/check/check_python_xml b/tools/check/check_python_xml index 95174f4688..de9ebac09c 100755 --- a/tools/check/check_python_xml +++ b/tools/check/check_python_xml @@ -1,11 +1,7 @@ #!/bin/bash # CHECK-INSTALL -function error { - echo - echo " *** Check for python-xml package FAILED" - exit 1 -} +RC=0 python -c ' import os.path, sys @@ -13,4 +9,11 @@ for p in sys.path: if os.path.exists(p + "/xml/dom/minidom.py"): sys.exit(0) sys.exit(1) -' || error +' || RC=1 + +if test ${RC} -ne 0; then + echo + echo " *** Check for python-xml package FAILED" +fi + +exit ${RC} -- 2.30.2